home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-16 | 1.2 KB | 37 lines | [TEXT/MPS ] |
- #-------------------------------------------------------------------------------
- # WhatLine
- # MPW Shell Script
- # Written by Gina Cherry • August 16, 1991
- # Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- #
- # Usage:
- # WhatLine [Window]
- #
- # Function:
- # WhatLine displays an alert dialog box with the current line number of the specified
- # window. If no window is specified, WhatLine operates on the target window.
- #
- # WhatLine can be added to the Commands menu with the following command:
- #
- # AddMenu Commands 'What Line' 'WhatLine "{Active}"'
- #-------------------------------------------------------------------------------
-
- # Do not exit on error.
- Set Exit 0
-
- # If more than one parameter is given, write an error message and exit the script.
- If {#} > 1
- Echo "###Usage: {0} [Window]"
- Exit 1
- End >> Dev:StdErr
-
- # Set Window to the parameter if one was given; otherwise set Window to the target window.
- If {#} == 1
- Set Window "{1}"
- Else
- Set Window "{Target}"
- End
-
- # Display the current line number of Window in an alert dialog. The Position command will
- # generate an error message if Window is not a valid window.
- Alert "Current line number: `Position -l "{Window}"`"